package com.jame.singleton;

/**
 * @author : Jame
 * @date : 2022-04-15 11:25
 **/
public class SingletonActively {
    //在声明时直接创建实例
    private static  SingletonActively singletonActively=new SingletonActively();


    //使用静态代码块创建实例
    private static  SingletonActively singletonActivelyStaticBlock;

    static{
        singletonActivelyStaticBlock=new SingletonActively();
    }

    /**
     * 私有构造
     */
    private SingletonActively(){

    }

    public static SingletonActively getSingletonActively(){
        return singletonActively;
    }

    public static SingletonActively getSingletonActivelyStaticBlock(){
        return singletonActivelyStaticBlock;
    }
}
